package com.xiaoshuidi.cloud.module.contract.enums.bill;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * 账单类型 default 合同账单 | custom 杂费账单 | free 免租期账单 |meter 抄表账单| carry 结转账单| owner 业主账单
 */
@Getter
@AllArgsConstructor
public enum OrderTypeEnum {
    DEFAULT("default", "合同账单"),
    CUSTOM("custom", "杂费账单"),
    FREE("free", "免租期账单"),
    METER("meter", "抄表账单"),
    CARRY("carry", "结转账单"),
    OWNER("owner", "业主账单"),
    EXTENSION("extension", "延期账单"),
    OWNER_EVICTION("owner_eviction", "业主退租账单"),
    COMPANY_BATCH_RENT("company_batch_rent", "企业批量退租账单");


    private final String code;
    private final String name;

    public static String getName(String code) {
        for (OrderTypeEnum c : OrderTypeEnum.values()) {
            if (c.getCode().equals(code)) {
                return c.name;
            }
        }
        return null;
    }

}
